Stacking technology enables two or more devices to be connected together to form a stacking system that can be managed as a single device, thus providing high availability and scalability, and simplifying management. A stacking system can comprise centralized devices or distributed devices. The devices of a stacking system are connected through stack cables in a daisy chain, ring, or star structure. Special topology management software is used to collect the topology information and the changes in the topology structure of the whole stacking system. The present invention is primarily applicable for collecting topology information in a daisy chain or ring structure.
Each member device of a stacking system comprising centralized devices, as shown in FIG. 1, has one or two stack ports, and periodically broadcasts topology advertisement messages through the stack port or ports to inform other member devices in the stacking system of the topology information of the sending member device. The topology information sent by each member device includes the member device ID, priority information, whether the current member device is the master device, bridge MAC addresses, and other topology information. One of the member devices in the stacking system is elected as the master device according to a predefined election strategy. The master device collects the topology information contained in the topology advertisement messages sent by other member devices, generates the topology information of the whole stacking system, and broadcasts the topology information to other member devices. All the other member devices store the topology information of the stacking system.
After storing the topology information of the stacking system, each member device maintains connections with neighboring devices by sending out hello packets periodically. When a member device detects that a neighboring device fails, that is, the port is down, the member device informs other member devices of the failure. The master device then re-collects the topology information of each member device, and broadcasts to other member devices the latest topology information of the stacking system, so that the member devices can update the stored topology information of the stacking system in time. When a new member device is introduced to the stacking system, the new member device informs the whole stacking system of its existence. The master device also re-collects the topology information of each member device and broadcasts the latest topology information of the whole stacking system to other member devices, so that the member devices can update the stored topology information of the stacking system in time.
In a stacking system comprising distributed single control board devices, each member device comprises one control board, one or two stack boards, and multiple service boards, as shown in FIG. 2a. The stacking system collects the topology information in the same way as the stacking system comprising distributed devices. The topology information advertised by the distributed single control board devices includes the internal topology information of the member devices, such as the slot numbers.
In a stacking system comprising distributed dual control board devices, each member device has two control boards, as shown in FIG. 2b. The control boards serve as the master control board and slave control board, respectively. Because both the master and slave control boards run topology management software, the two control boards serve as two topology nodes in the stacking system. If the master control board fails, the slave control board takes over the job of the master control board in time, and thus the stacking system can operate normally. Due to its particularity, a distributed dual control board device cannot use the topology collection method for centralized devices and distributed single control board devices. A method suitable for collecting the topology information of a stacking system comprising distributed dual control board devices is needed.